System and method for latency-based queuing

ABSTRACT

Embodiments of the present invention are directed to systems and methods for queuing and sending messages to recipients according to historical latency values associated with each recipient. In some embodiments, a plurality of messages are received, each message including a network address of a recipient. The messages are sent to the recipients by threads that remain active (i.e., cannot be used to send another message) until confirmation responses are received from the recipients. Latency times are measured between when the messages were sent and when the confirmation responses were received. The latency times may be used to assign future messages to queues designated by certain latency ranges.

CROSS-REFERENCES TO RELATED APPLICATIONS

The present application is a continuation of U.S. application Ser. No.15/144,216, filed May 2, 2016, which is hereby incorporated by referencein its entirety for all purposes.

BACKGROUND

Conventional messaging techniques place all messages to be delivered ina single queue. Each message is allocated to a thread to be sent,generally in the order that they are generated or received. Incommunication protocols that require a confirmation response from therecipient, the thread remains active and cannot be used to send the nextmessage in the queue until the confirmation response is received fromthe message recipient. Thus, when a message recipient takes a long timeto send a confirmation response, the remaining messages in the queue aredelayed in being sent.

Some techniques can use multiple queues, but current methods still donot address certain problems that can arise when sending messages tomany, various recipient computers.

SUMMARY

Thus, there is a need for new and enhanced systems and methods ofqueuing and sending messages that reduces the delay caused byslow-responding message recipients. Embodiments of the invention canaddress these and other problems, individually and collectively.

Embodiments of the invention are directed to systems and methods relatedto real-time latency-based queuing of messages that can reduce delay indelivering the messages.

One embodiment of the invention is directed to a method comprisingreceiving, at a server computer system, a plurality of messages, eachmessage including a network address of a recipient computer. The methodfurther comprises sending, by the server computer system over a network,the messages to the recipient computers, each of the plurality ofmessages being sent by a thread of a plurality of threads executing onthe server computer system, wherein the thread is required to wait for aconfirmation response from the corresponding recipient computer beforesending another message of the plurality of messages. The method furthercomprises determining a latency time for the confirmation response to bereceived by the server computer system for each of the plurality ofmessages. The method further comprises receiving, at the server computersystem, a first message including a first network address of a firstrecipient computer, and determining whether other messages havepreviously been sent to the first network address of the first recipientcomputer. The method further comprises, after determining that othermessages have previously been sent to the first network address:determining a latency value for response to the other messagesassociated with the first network address, placing the first message ina first latency queue based on the latency value for response beingbelow a first threshold, and placing the first message in a secondlatency queue based on the latency value for response being above thefirst threshold. Different threads of the plurality of threads areallocated to the first latency queue and the second latency queue.

Another embodiment of the invention is directed to a server computersystem comprising a processor and memory coupled to the processor. Thememory stores instructions, which when executed by the processor, causethe server computer system to perform operations including the steps ofthe above method.

These and other embodiments of the invention are described in furtherdetail below.

BRIEF DESCRIPTION OF THE DRAWINGS

FIG. 1 shows a block diagram showing a system for sending messages andreceiving confirmation responses over a network according to anembodiment of the present invention.

FIG. 2 shows a flow diagram depicting a method for determining latencyvalues according to an embodiment of the present invention.

FIG. 3 shows a flow diagram depicting a method for allocating messagesto queues based on their historical latency values according to anembodiment of the present invention.

FIG. 4 shows a flow diagram depicting a method for queuing messages,sending messages, and measuring latency values for response, accordingto an embodiment of the present invention.

FIG. 5 shows a flow diagram depicting a method for latency-based queuingaccording to an embodiment of the present invention.

FIG. 6 shows a block diagram of a server computer system forlatency-based queuing according to an embodiment of the presentinvention.

FIG. 7 shows a block diagram of a recipient computer for receivingmessages and sending confirmation responses according to an embodimentof the present invention.

TERMS

Prior to discussing specific embodiments of the invention, some termsmay be described in detail.

A “confirmation response” may include any message sent by a recipient toa sender confirming receipt of a message from the sender. Theconfirmation response may include any combination of letters, numbers,and/or symbols representing or communicating receipt of the message. Theconfirmation response may include an identifier of the recipient, anidentifier of the original message, and/or the original message itselfso that the confirmation response may be matched to the originalmessage. The confirmation response may be automatically generated by therecipient.

A “hash” may include any combination of letters, numbers and/or symbolsrepresenting a string of text. A hash is typically shorter in lengththan the underlying string of text, and is generated in such a way thatit is unlikely that a different string of text will produce the samehash. A hash may be used to efficiently store and access data records,and to provide security for data records.

A “latency time” may include any delay or lapse in time between inputand a desired outcome. For example, a latency time for response maycorrespond to the elapsed time between when a message is sent by asender to a recipient, and when a confirmation response is received bythe sender from the recipient. A “latency value” may be a property of aplurality of messages, such as a mean, median or mode value of aplurality of latency times. A “threshold latency value” may correspondto any particular latency value, and may be selected as describedfurther herein.

A “message” may include any communication from one party or entity toanother party or entity. The communication may include, for example,information or data in any suitable form. Further, the message may betransmitted by any suitable method such as, for example, over a network.

A “network address” may include any combination of letters, numbersand/or symbols identifying a device on a network. Exemplary networkaddresses include Internet Protocol (IP) addresses, media access control(MAC) addresses, host addresses, Uniform Resource Identifier (URI)addresses, and the like. A network address may be unique to anindividual device or may be unique to a component within an individualdevice. For example, a computer's WiFi may have a different networkaddress than its local area network (LAN) card. In one embodiment, anetwork address may include an e-mail address.

A “queue” may include a collection of ordered messages defined by someparameter. For example, a queue may be defined by a range of latencyvalues. A queue may pass messages to be sent to one or more threadsassigned to that queue.

A “server computer system” may include a computer or cluster ofcomputers. For example, the server computer system can be a largemainframe, a minicomputer cluster, or a group of servers functioning asa unit. In one example, the server computer system may be a databaseserver coupled to a Web server. The server computer system may becoupled to a database and may include any hardware, software, otherlogic, or combination of the preceding for servicing the requests fromone or more client computers. The server computer system may compriseone or more computational apparatuses and may use any of a variety ofcomputing structures, arrangements, and compilations for servicing therequests from one or more client computers.

A “thread” may include any process (or instance of a process) executingon a computer. A thread may be configured to send messages via acommunications channel, e.g., a network socket. The thread may furtherbe configured to receive confirmation responses of receipt of messages.

DETAILED DESCRIPTION

Embodiments of the present invention are directed to systems and methodsfor queuing and sending messages to recipients according to historicallatency values associated with each recipient. In some embodiments, aplurality of messages are received, each message including a networkaddress of a recipient. The messages are sent to the recipients bythreads that remain active (i.e., cannot be used to send anothermessage) until confirmation responses are received from the recipients.Latency times are measured between when the messages were sent and whenthe confirmation responses were received. The latency times may be usedto assign future messages to queues designated by certain latencyranges.

Embodiments can be used to reduce delay in sending messages caused byslow-responding recipients. Thus, threads may be cleared quickly andused to send further messages, reducing the overall number of threadsneeded to send messages and reducing costs associated with adding newthreads. Further, more messages can be delivered in a shorter amount oftime. This is important in high-volume messaging systems that may handle700,000 or more messages per day.

I. Messaging

Messaging is the process of delivering any type of data from a sender toa recipient. The data may contain any information that needs to becommunicated to the recipient. Messaging may occur over a network, forexample, to transmit data to a remote party. In messaging systems,individual messages are placed in a single queue based on their time ofgeneration or receipt, and sent in order.

FIG. 1 illustrates a block diagram of a messaging system according to anembodiment of the present invention. FIG. 1 illustrates a servercomputer system 100 communicating with recipient computers 120A-C over anetwork 110. Network 110 may be any type of network, including a privateor public network. A private network may include networks for a largesite, such as a corporate office, a university campus, a hospital, agovernment office, or a similar entity. A network such as illustrated bythe example network 110 may also be found at small sites, such as in aprivate home. A public network may include the Internet. Network 110 mayinclude third-party telecommunication lines, such as phone lines,broadcast coaxial cable, fiber optic cables, satellite communications,cellular communications, and the like.

Server computer system 100 sends a message 103A to recipient computer120A over network 110, and receives a confirmation response 107A fromrecipient computer 120A over network 110 after a certain latency time.Similarly, server computer system 100 sends a message 103B to recipientcomputer 120B over network 110, and receives a confirmation response107B from recipient computer 120B over network 110 after a certainlatency time. Server computer system 100 also sends a message 103C torecipient computer 120C over network 110, and receives a confirmationresponse 107C from recipient computer 120C over network 110 after acertain latency time.

The messages 103A-C may be any type of messages sent over a network 110that require confirmation responses 107A-C. For example, messages 103A-Cmay use Hypertext Transfer Protocol (HTTP), Transmission ControlProtocol (TCP), and the like. Although shown and described in FIG. 1 ashaving three messages 103A-C, it is contemplated that any number ofmessages may be sent over network 110 over any period of time accordingto embodiments of the invention. For example, hundreds of thousands oreven millions of messages may be sent over network 110 over a 24-hourperiod.

In conventional systems, messages 103A-C may be placed in a singlequeue, and allocated to one or more threads to be sent in the order thatthey are generated or received. The thread remains active and cannot beused to send a next message in the queue until a confirmation responseis received from the message recipient.

For example, a conventional system may have one queue and one thread towhich messages 103A-C are allocated in order. The first message 103A maybe sent to a first recipient computer 120A using the thread. If thefirst confirmation response 107A isn't received by the server computersystem 100 until 60 seconds later, the second message 103B cannot beallocated to the thread and sent until 60 seconds later (i.e., after thefirst confirmation response 107A is received), delaying transmission ofthe second message 1036. Further, if the second confirmation response1076 isn't received by the server computer system 100 until 30 secondsafter the message is sent to the second recipient computer 120B, thethird message 103C cannot be allocated to the thread and sent until 30seconds later (i.e., after the second confirmation response 107B isreceived), delaying transmission of the third message 103C.

Thus, in this example, transmission of the third message 103C to therecipient computer 120C has been delayed by 90 seconds. This isparticularly inconvenient if the third message 103C is a high prioritymessage or if recipient computer 120C has a historically low latencytime (e.g., 100 milliseconds), as the third message 103C could have beensent before and/or been prioritized higher than the first message 103Aand the second message 103B. Thus, it is preferable to send messages103A-C in such a way that rewards fast-responding recipients and doesnot result in unnecessary delay.

II. Latency-Based Queuing

Embodiments of the present invention assign messages to be sent toqueues based on the historical latency times of their recipients, forexample, to reduce delays in sending messages.

A. Determining Latency Times

FIG. 2 shows a flow diagram depicting a method for determining latencytimes according to an embodiment of the invention. The method may beperformed by a server computer system that generates messages orreceives messages from one or more other sources. As an example, theserver computer system can generate messages using information receivedfrom a plurality of other servers, e.g., HTTP servers.

At step 205, a plurality of messages are sent to recipients. Themessages may be sent by a server computer system, for example. Themessages may be any type of messages sent over a network that requireconfirmation responses or in which confirmation responses are desired,such as HTTP messages, TCP messages, and the like. The recipients may beany component or device having a network address.

At step 210, confirmation responses acknowledging receipt of themessages are received from the recipients. The confirmation response mayinclude an identifier of the recipient (e.g., a network address), anidentifier of the original message (e.g., a value or code), and/or theoriginal message itself so that the confirmation response may be matchedto the original message.

At step 215, the amount of time between the messages being sent and thecorresponding confirmation responses being received is determined. Thisamount of time corresponds to a latency time for response. For example,a timestamp created when a particular message was sent can be comparedto a timestamp of when the corresponding confirmation response wasreceived to determine the latency time for response to that message.

At step 220, queues for future messages for a particular recipient canbe determined based on the historical latency times for response. Forexample, all or some of the historical latency times for response forthat recipient can be used to determine a mean, median or mode latencyvalue. In another example, the latency value may correspond to apercentile, such as the latency value below which 70% of confirmationresponses are received. In still another example, a single historicallatency time may be selected, such as the most recent latency time, thehighest latency time, the lowest latency time, or the only latency timewhen only one historical latency time is available.

This latency value may be used to allocate any future messages receivedfrom that recipient to a queue designated by a particular range oflatency values. For example, if the recipient has a 300 millisecond meanlatency value, a future message to be sent to that recipient may beallocated to a queue dedicated to recipients having latency valuesbetween 200 and 400 milliseconds. There may also be a default queue towhich messages for recipients having unknown latency values or nohistorical latency times are allocated. These concepts are describedfurther herein with reference to FIG. 3.

B. Queue Allocation

A pool of messages to be sent may be allocated to a plurality of queuesbased on their historical latency times to reduce delay in sending themessages. Messages for a same recipient computer can be allocated to asame queue, which also includes messages for other recipient computersthat have similar latency values for responding to the messages. In thismanner, recipient computers that respond quickly are not negativelyimpacted by waiting for responses from slower recipient computers.

FIG. 3 shows a block diagram depicting an allocation of messages toqueues based on their historical latency times. At block 315, a pool ofmessages 315A-I is received. Messages 315A-I are initially ordered inthe pool according to their time of receipt, for example.

Messages 315A-I have a variety of latency values associated with theirrecipients. For example, message 315A has a latency value of 500milliseconds; message 315B has a latency value of 750 milliseconds;message 315C has a latency value of 60 seconds; message 315D has alatency value of 100 milliseconds; message 315F has a latency value of30 seconds; message 315G has a latency value of 550 milliseconds; andmessage 315I has a latency value of 150 milliseconds. Messages 315E and315H have unknown latency values. The latency values may be unknownbecause the recipients associated with messages 315E and 315H have notbeen previously sent messages, for example. In another example, thelatency values may be unknown due to errors or mismatches betweenprevious messages and confirmation responses. Thus, no historicallatency times have been recorded for these messages.

At block 320, messages 315A-I are allocated to queues. Three queues areshown in FIG. 3: a first latency queue 320A, a second latency queue320B, and a default queue 320C. Messages are allocated to first latencyqueue 320A based on their latency values being less than or equal to athreshold latency value. In this example, the threshold latency value is600 milliseconds. Thus, messages 315A, 315D, 315G, and 315I areallocated to the first latency queue 320A.

Messages are allocated to second latency queue 320B based on theirlatency values being greater than the threshold latency value. Thus,messages 3156, 315C, and 315F are allocated to the second latency queue320B.

Messages are allocated to the default queue 320C based on their latencyvalues being unknown. Thus, messages 315E and 315H are allocated to thedefault queue 320C. In one embodiment, messages may be allocated to thedefault queue 320C until they have a certain number of measuredhistorical latency times. For example, messages may be allocated to thedefault queue if their latency value is based on five or less measuredhistorical latency times.

In some embodiments, other factors may be considered when allocatingmessages to queues. For example, a high priority message having alatency value greater than the threshold, or a high priority messagehaving an unknown latency value, may nevertheless be allocated to thefirst latency queue 320A to ensure that it is sent as quickly aspossible. Similarly, a low priority message having a latency value belowthe threshold, or a low priority message having an unknown latencyvalue, may nevertheless be allocated to the second latency queue 320Bsince its receipt may not be as critical. In another example, a servicelevel agreement with a certain sender may specify that its messages gointo a particular latency queue, regardless of the latency value. Instill another example, certain senders may be organized into tiers basedon any of a number of factors, with messages from each tier beingassigned to a particular queue regardless of the latency value.

Although shown and described as having three queues (i.e., first latencyqueue 320A, second latency queue 320B, and default queue 320C), it iscontemplated that any number of queues may be established based on anyrange of latency values. For example, a first latency queue maycorrespond to latency values less than or equal to 400 milliseconds; asecond latency queue may correspond to latency values between 400 and600 milliseconds; and a third latency queue may correspond to latencyvalues greater than or equal to 600 milliseconds and unknown latencyvalues.

The historical latency times for messages to recipients that havepreviously received a plurality of messages (i.e., that have a pluralityof historical latency time measurements) may be combined in any mannerto produce a latency value. For example, a mean, median or mode may becalculated of the plurality of historical latency time measurements toestablish a single latency value to be used for a recipient.

The threshold latency value (in this example, 600 milliseconds) may beany latency time, and may be established according to any method. Forexample, the threshold latency value may be arbitrarily and/or randomlychosen. In another example, the threshold latency value may be selectedbased on the mean, median or mode latency value for response for aplurality of messages to a plurality of recipients. Further, thethreshold latency value may be dynamically changed after it is selectedbased on a current volume of messages in each queue. For example, thethreshold latency value may be changed based on a first number ofmessages in the first latency queue 320A and based on a second number ofmessages in the second latency queue 320B. Thus, the load across all ofthe queues may be effectively balanced by adjusting the thresholdlatency value. In one embodiment, the threshold latency value isselected and updated automatically.

At block 325, messages 315A-I are allocated to threads to be sent.Messages 315A, 315D, 315G, and 315I (i.e., messages within the firstlatency queue 320A) are allocated to a first set of threads 325A.Messages 3156, 315C, and 315F (i.e., messages within the second latencyqueue 320B) are allocated to a second set of threads 325B. Messages 315Eand 315H (i.e., messages within the default queue 320C) are allocated toa third set of threads 325C. Any number of threads may be included inthe first set of threads 325A, the second set of threads 325B, and thethird set of threads 325C, and that number may be changed at any time orcontinuously, as described further herein. Further, new threads may beadded to increase the overall number of threads at any time.

One message may be sent by one thread at a time, with the threadremaining active until a corresponding confirmation response isreceived. For example, a thread within the first set of threads 325A maysend message 315A. Only after receiving a corresponding confirmationresponse to message 315A may the thread send another message in thefirst latency queue 320A (e.g., message 315D, 315G, or 315I).

The messages may be allocated to the threads in any order, such as inthe order that they are received, according to their latency times,according to their priority, or any combination thereof. For example,message 315D may be allocated to a thread within the first set ofthreads 325A first, because it has the shortest latency value of 100milliseconds. In another example, if message 315G is a high prioritymessage, it may be allocated to a thread within the first set of threads325A first, with the remaining messages 315D, 315G, and 315I being sentin order.

Once the messages 315A-I are allocated to threads, they are sent by thethreads and confirmation responses are received. The latency time forresponse to each message is measured and recorded.

C. Sequence Diagrams

Various methods may be used to implement the embodiments of theinvention described above. FIG. 4 shows a flow diagram depicting amethod for queuing messages, sending messages, and measuring latencytimes for response according to an embodiment of the invention. Thesteps of FIG. 4 may be executed, for example, by server computer system600 of FIG. 6, described further herein.

At step 405, a message is generated or received. The message may includeany data to be transmitted to a recipient over a network, for example.The message may include a network address associated with andidentifying the recipient. A recipient may have one or a plurality ofnetwork addresses associated with it. In one embodiment, a hash of thenetwork address associated with the recipient is generated. The hash maybe any combination of letters, numbers and/or symbols representing thenetwork address or any portion of the network address (e.g., a domainname).

At step 410, it is determined whether messages were previously sent tothe network address associated with the recipient. For example, thenetwork address may be compared with stored network addresses associatedwith previously sent messages in a database. In another example in whicha hash of the network address was generated, the hash may be compared tostored hashes of network addresses associated with previously sentmessages in a database. Because a given recipient may be associated witha plurality of network addresses, each having the same or differentlatency values, network addresses are used for comparison, instead of arecipient identifier or name in this embodiment. In another embodiment,however, a recipient identifier or name could alternatively oradditionally be used for comparison.

If messages were not previously sent to the network address, the messageis placed in a default queue at step 413. The default queue may bedefault queue 320C of FIG. 3, for example. The method continues at step430, as described further herein.

If messages were previously sent to the network address, a latency valuefor response associated with the network address is determined at step415. For example, a record of one or more historical latency times forresponse may be stored in association with the network address in adatabase. A mean, median or mode of a plurality of historical latencytimes associated with the network address may be calculated to determinea single latency value for response associated with the network address.The mean, median or mode may be calculated based on all of the pluralityof historical latency times, or based on any subset of the plurality ofhistorical latency times. For example, the mean, median or mode may becalculated of the last n historical latency times (i.e., the n mostrecent historical latency times). In another example, only the mostrecent historical latency time can be used as the latency value forresponse. In still another example, the fastest or slowest historicallatency time can be used as the latency value for response. However, itis contemplated that any or all of the historical latency times can beused to determine the latency value for response associated with anetwork address.

At step 420, it is determined whether the latency value for responseassociated with the network address is above a threshold. If the latencyvalue for response is not above the threshold, the message is placed ina first latency queue at step 423. The first latency queue may be firstlatency queue 320A of FIG. 3, for example. The method then continues atstep 430, as described further herein.

If the latency value for response is above the threshold, the message isplaced in a second latency queue at step 425. The second latency queuemay be second latency queue 320B of FIG. 3, for example. The method thencontinues at step 430.

At step 430, after the message is placed in either the default queue atstep 413, the first latency queue at step 423, or the second latencyqueue at step 425, the message is sent to the network address. At somepoint later, a confirmation response is received from the networkaddress at step 435. The confirmation response may include an identifierof the recipient, an identifier of the original message, and/or theoriginal message itself so that the confirmation response may be matchedto the original message.

At step 440, the latency time for response is determined and recorded ina database in association with the network address. For example, theelapsed time is calculated between when the message was sent and whenthe corresponding confirmation response was received using theirtimestamps. This latency time for response may then be used to allocatefuture messages to that network address to a particular queue, asdescribed further herein. The method then returns to step 405 to receiveand process another message.

Latency values for a plurality of messages may be determined and used toallocate a future message to a particular queue, as illustrated in FIG.5. Aspects of methods depicted in FIG. 2 and FIG. 4 can be used in FIG.5.

FIG. 5 shows a flow diagram depicting a method for latency-based queuingaccording to an embodiment of the invention. At step 505, a plurality ofmessages are received at a server computer system. The server computersystem may be, for example, server computer system 600 of FIG. 6, asdescribed further herein. Each message includes a network address of arecipient computer. In one embodiment, a hash of each network addressmay be generated and stored in a database.

At step 510, the messages are sent over a network to the recipientcomputers using the network address. Each of the plurality of messagesare sent by a thread of a plurality of threads executing on the servercomputer system. The threads may be, for example, any threads within thefirst set of threads 325A, the second set of threads 325B, and/or thethird set of threads 325C of FIG. 3. Any number of threads may be usedto send messages, depending on demand and capacity, but may be in thehundreds or even thousands. The messages may be sent to the recipientcomputers using at least one of HTTP, TCP, and the like

Each thread is required to wait for a confirmation response from thecorresponding recipient computer before sending another message of theplurality of messages. Thus, if an error or timeout occurs, the messagemay be reassigned to the same or a different queue, and/or the thread ora different thread may attempt to send the message again, and wait for aproper confirmation response. A timeout may occur after anypredetermined amount of time, such as, for example, 5 minutes after themessage is sent. In one embodiment, when the message is reassigned, itmay be reassigned to a different queue than was originally assigned. Forexample, the message may be assigned to a lower priority queue each timean error or timeout occurs. In one embodiment, after a threshold numberof delivery attempts (e.g., 5 delivery attempts), the message may eitherbe dropped or put into a separate queue for manual review.

At step 515, a latency time for the confirmation response to be receivedby the server computer system is determined for each of the plurality ofmessages. For example, the time between when the message was sent andwhen the corresponding confirmation response was received may bemeasured by comparing timestamps, for example, or by starting a timerwhen the message is sent and stopping it when the correspondingconfirmation response is received. The confirmation response may bematched with its corresponding message by an identifier, for example.

At step 520, a first message is received at the server computer system.The first message includes a first network address of a first recipientcomputer. In one embodiment, a hash of the first network address may begenerated.

At step 525, it is determined that other messages have been previouslysent to the first network address of the first recipient computer. Thisdetermination may be made, for example, by comparing the first networkaddress to network addresses associated with previously sent messages ina database. In another example, this determination may be made bycomparing the hash of the first network address to the stored hashes ofnetwork addresses associated with previously sent messages in adatabase. If other messages have not been previously sent to the firstnetwork address, the first message may be placed in a default queue,such as default queue 320C of FIG. 3, for example.

After determining that other messages have previously been sent to thefirst network address, however, a latency value for response to theother messages associated with the first network address is determinedat step 530. The latency value may be a statistical parameter of astatistical distribution of historical latency times associated with aplurality of other messages to the first network address. Thestatistical parameter may be calculated as a mean, a mode, or a medianof the statistical distribution, for example.

At step 535, it is determined whether the latency value is above athreshold. If the latency value is not above the threshold, the messageis placed in a first latency queue at step 537. The first latency queuemay be first latency queue 320A of FIG. 3, for example.

If the latency value is above the threshold, the message is placed in asecond latency queue at step 540. The second latency queue may be secondlatency queue 320B of FIG. 3, for example. After placing the message inthe second latency queue, the server computer system may generate analert to the first recipient computer notifying the first recipientcomputer that the latency value for response is above the threshold forthe first network address. This may allow the first recipient computerto make adjustments to improve future latency times for the firstnetwork address.

In one embodiment, the threshold latency value may be selectedarbitrarily or randomly. In another embodiment, the threshold may be amedian, mean or mode latency value for a plurality of messages and/orfor a plurality of recipients at any given time, over a period of time,or over all time. In either embodiment, the threshold latency value maybe dynamically changed at any point (i.e., at any time or at aparticular interval) or continuously. For example, the threshold latencyvalue may be dynamically changed based on the volume of messages in thefirst latency queue and the second latency queue at a particular point.In other words, the loads at the first latency queue and the secondlatency queue may be balanced by adjusting the threshold.

Different threads of the plurality of threads are allocated to the firstlatency queue and the second latency queue. For example, a first set ofthreads 325A may be allocated to the first latency queue, and a secondset of threads 325B may be allocated to the second latency queue, asshown in FIG. 3. In one embodiment, the number of threads allocated toeach queue may be selected arbitrarily or randomly. Alternatively oradditionally, the number of threads in each set (i.e., the number ofthreads allocated to a particular queue) may be dynamically determinedor changed at any point (i.e., at any time or at a particular interval)or continuously. In one embodiment, the number of threads allocated tothe first latency queue and the second latency queue can be dynamicallychanged based on the volume of messages in the first latency queue andthe second latency queue at a particular point. For example, the numberof threads allocated to the first latency queue and the second latencyqueue can be dynamically changed based on a first number of messages inthe first latency queue and based on a second number of messages in thesecond latency queue. Thus, the loads at the first latency queue and thesecond latency queue may be balanced by adjusting the number of threadsallocated to each queue.

III. Example Systems

Various systems may be used to implement the methods described above.Examples of a server computer system and a recipient computer system arenow described.

FIG. 6 shows a block diagram of a server computer system 600 forlatency-based queuing according to an embodiment of the presentinvention. Server computer system 600 may implement any of the methodsdescribed herein. Server computer system 600 may include a processor 601coupled to a network interface 602 and a computer readable medium 606.Server computer system 600 may also include or otherwise have access toa database 603 that may be internal or external to server computersystem 600. In one embodiment, database 603 is an in-memory database.

Processor 601 may include one or more microprocessors to execute programcomponents for performing the latency-based queuing functions of servercomputer system 600. Network interface 602 can be configured to connectto one or more communication networks to allow server computer system600 to communicate with other entities, such as recipient computer 700of FIG. 7. Computer readable medium 606 may include any combination ofone or more volatile and/or non-volatile memories, for example, RAM,DRAM, SRAM, ROM, flash, or any other suitable memory components.Computer readable medium 606 may store code executable by the processor601 for implementing some or all of the latency-based queuing functionsof server computer system 600. For example, computer readable medium 606may include code implementing a hashing module 608, a latencydetermination module 610, a queue allocation module 612, a threadallocation module 614, a threshold selection module 616, and an alertmodule 618. Although shown and described as having each of thesemodules, it is contemplated that more or fewer modules may beimplemented within computer readable medium 606. For example, a hashingmodule 608, a threshold selection module 616, and/or an alert module 618may not be implemented in all embodiments.

Hashing module 608 may, in conjunction with processor 601, generatehashes of the network addresses and/or portions of network addresses ofrecipient computers for messages. The hashes corresponding to thenetwork addresses may be stored in database 603. Hashing module 608 mayfurther, in conjunction with processor 601, compare generated hashes ofnetwork addresses to stored hashes of network addresses to determinewhether messages have been previously sent to particular networkaddresses.

Latency determination module 610 may, in conjunction with processor 601,measure latency times between when messages are sent and when theircorresponding confirmation responses are received. For example, latencydetermination module 610 may, in conjunction with processor 601, recorda first timestamp when a message is sent and a second timestamp when acorresponding confirmation response is received. Latency determinationmodule 610 may then, in conjunction with processor 601, measure theamount of time elapsed between the first timestamp and the secondtimestamp to determine a latency time. The latency time may be stored inconjunction with a network address or hash of a network address indatabase 603.

Latency determination module 610 may further, in conjunction withprocessor 601, determine a latency value based on a plurality ofhistorical latency times. The latency value may be a mean, median ormode of the plurality of historical latency times, for example. Themean, median or mode may be calculated based on all of the plurality ofhistorical latency times, or based on any subset of the plurality ofhistorical latency times.

Queue allocation module 612 may, in conjunction with processor 601,place a message in a queue based on a latency value. For example, queueallocation module 612 may, in conjunction with processor 601, place amessage in a first latency queue if the latency value is below athreshold, place the message in a second latency queue if the latencyvalue is above a threshold, or place the message in a default queue ifthe latency value is unknown. The latency value used to determine queueallocation may be an overall latency value based on all latency timesrecorded and associated with a network address, or may be based on asubset of recorded latency times, such as the last n latency times. Inanother embodiment, the latency value used may be the fastest latencytime, the slowest latency time, and/or the most recent latency time.

Thread allocation module 614 may, in conjunction with processor 601,send messages from a queue to a thread dedicated to that queue. Threadallocation module 614 may, in conjunction with processor 601, send afirst message of a plurality of messages in a queue, and wait until acorresponding confirmation response is received before sending a secondmessage of the plurality of messages in the queue. Each thread isdedicated to a particular queue. Thread allocation module 614 mayfurther, in conjunction with processor 601, dynamically determine orchange the number of threads allocated to each queue based on, forexample, the number of messages in each queue at a given time. Thus,thread allocation module 614 may, in conjunction with processor 601,balance load across the queues.

Threshold selection module 616 may, in conjunction with processor 601,set a threshold latency time upon which queues are defined. In oneembodiment, the threshold is selected or changed arbitrarily orrandomly. In another embodiment, the threshold is selected or changedbased on a mean, median or mode latency time of a plurality of networkaddresses at a given time. In still another embodiment, the threshold isdynamically selected or changed based on, for example, the number ofmessages in each queue at a given time. Thus, threshold selection module616 may, in conjunction with processor 601, balance load across thequeues.

Alert module 618 may, in conjunction with processor 601, alert arecipient computer that its latency time for response at a particularnetwork address is above a threshold. The alert may be in the form of asubsequent message. This allows the recipient computer to make anydesired changes to decrease its latency time, thus potentially allowingthe recipient computer to receive messages faster in the future ifallocated to a different queue.

FIG. 7 shows a block diagram of a recipient computer 700 for receivingmessages and sending confirmation responses according to an embodimentof the present invention. Recipient computer 700 may implement any ofthe recipients and/or recipient computers described herein. Recipientcomputer 700 may include a processor 701 coupled to a network interface702 and a computer readable medium 706. Recipient computer 700 may alsoinclude or otherwise have access to a database 703 that may be internalor external to server computer system 600.

Processor 701 may include one or more microprocessors to execute programcomponents for performing the receiving and sending functions ofrecipient computer 700. Network interface 702 can be configured toconnect to one or more communication networks to allow recipientcomputer 700 to communicate with other entities, such as server computersystem 600 of FIG. 6. Computer readable medium 706 may include anycombination of one or more volatile and/or non-volatile memories, forexample, RAM, DRAM, SRAM, ROM, flash, or any other suitable memorycomponents. Computer readable medium 706 may store code executable bythe processor 701 for implementing some or all of the receiving andsending functions of recipient computer 700. For example, computerreadable medium 706 may include code implementing a confirmationresponse module 708.

Confirmation response module 708 may, in conjunction with processor 701,receive messages and generate confirmation responses that the messageswere received. The confirmation response may include any combination ofletters, numbers, and/or symbols representing or communicating receiptof the message. The confirmation response may include an identifier ofthe recipient, an identifier of the original message, and/or theoriginal message itself so that the confirmation response may be matchedto the original message by the sender.

IV. Examples A. Transaction Processing

Embodiments of the present invention may be used in messaging fortransaction processing. Specifically, messages may be queued and sentbetween access devices, merchant computers, acquirer computers, paymentprocessing networks, and/or issuers. Exemplary messages may be sent frompayment processing networks (e.g., server computer systems) to merchantcomputers (e.g., recipient computers), and may include a confirmationthat a transaction has occurred, a confirmation that a payment wentthrough, a confirmation that a fraud check has been completed, customerloyalty information, and the like.

B. Additional Embodiments

Embodiments of the present invention may additionally or alternativelybe used to deliver any messages to any third parties over a network. Inone embodiment, Short Message Service (SMS) messages may be managed bythe latency-based queuing systems and methods described herein, with thenetwork address of the recipient corresponding to a mobile phone number.In another embodiment, webhooks for web applications may be managed bythe latency-based queuing systems and methods described herein (e.g.,push notifications to a user of a website).

V. Example Computer Systems

The various participants and elements described herein may operate oneor more computer apparatuses to facilitate the functions describedherein. Any of the elements in the above-described figures, includingany servers or databases, may use any suitable number of subsystems tofacilitate the functions described herein.

Such subsystems or components are interconnected via a system bus.Subsystems may include a printer, keyboard, fixed disk (or other memorycomprising computer readable media), monitor, which is coupled todisplay adapter, and others. Peripherals and input/output (I/O) devices,which couple to an I/O controller (which can be a processor or othersuitable controller), can be connected to the computer system by anynumber of means known in the art. For example, an external interface canbe used to connect the computer apparatus to a wide area network such asthe Internet, a mouse input device, or a scanner. The interconnectionvia the system bus allows the central processor to communicate with eachsubsystem and to control the execution of instructions from systemmemory or the fixed disk, as well as the exchange of information betweensubsystems. The system memory and/or the fixed disk may embody acomputer readable medium.

Any of the software components or functions described in thisapplication, may be implemented as software code to be executed by aprocessor using any suitable computer language such as, for example,Java, C++ or Perl using, for example, conventional or object-orientedtechniques. The software code may be stored as a series of instructions,or commands on a computer readable medium, such as a random accessmemory (RAM), a read only memory (ROM), a magnetic medium such as ahard-drive or a floppy disk, or an optical medium such as a CD-ROM. Thecomputer readable medium may be any combination of such storage ortransmission devices.

Such programs may also be encoded and transmitted using carrier signalsadapted for transmission via wired, optical, and/or wireless networksconforming to a variety of protocols, including the Internet. As such, acomputer readable medium according to an embodiment of the presentinvention may be created using a data signal encoded with such programs.Computer readable media encoded with the program code may be packagedwith a compatible device or provided separately from other devices(e.g., via Internet download). Any such computer readable medium mayreside on or within a single computer product (e.g. a hard drive, a CD,or an entire computer system), and may be present on or within differentcomputer products within a system or network. A computer system mayinclude a monitor, printer, or other suitable display for providing anyof the results mentioned herein to a user.

Any of the methods described herein may be totally or partiallyperformed with a computer system including one or more processors, whichcan be configured to perform the steps. Thus, embodiments can bedirected to computer systems configured to perform the steps of any ofthe methods described herein, potentially with different componentsperforming a respective steps or a respective group of steps. Althoughpresented as numbered steps, steps of methods herein can be performed ata same time or in a different order. Additionally, portions of thesesteps may be used with portions of other steps from other methods. Also,all or portions of a step may be optional. Additionally, any of thesteps of any of the methods can be performed with modules, units,circuits, or other means for performing these steps.

The above description is illustrative and is not restrictive. Manyvariations of the invention may become apparent to those skilled in theart upon review of the disclosure. The scope of the invention can,therefore, be determined not with reference to the above description,but instead can be determined with reference to the pending claims alongwith their full scope or equivalents.

One or more features from any embodiment may be combined with one ormore features of any other embodiment without departing from the scopeof the invention.

A recitation of “a”, “an” or “the” is intended to mean “one or more”unless specifically indicated to the contrary.

All patents, patent applications, publications, and descriptionsmentioned above are herein incorporated by reference in their entiretyfor all purposes. None is admitted to be prior art.

What is claimed is:
 1. A server computer system comprising: a processor;and a memory coupled to the processor, the memory storing instructions,which when executed by the processor, cause the server computer systemto perform operations including: receiving a plurality of messagesincluding network addresses of recipient computers, each messageincluding a network address of a recipient computer; sending, over anetwork, the messages to the recipient computers; determining a latencytime for a confirmation response to be received by the server computersystem for each of the plurality of messages; receiving a first messageincluding a first network address of a first recipient computer;determining whether other messages have previously been sent to thefirst network address of the first recipient computer; after determiningthat other messages have previously been sent to the first networkaddress: determining a latency value for response to the other messagesassociated with the first network address; comparing the latency valueto a first threshold; and determining whether to place the first messagein a first latency queue or in a second latency queue based on thecomparing of the latency value to the first threshold.
 2. The servercomputer system of claim 1, wherein the first latency queue correspondsto one or more network addresses having lower latency values forresponses than one or more network addresses corresponding to the secondlatency queue.
 3. The server computer system of claim 1, wherein theoperations further include: generating hashes of at least a portion ofthe network addresses of the recipient computers for the plurality ofmessages; storing the hashes in a database; and generating a first hashof at least a portion of the first network address, wherein determiningthat other messages have previously been sent to the first networkaddress comprises comparing the first hash to the stored hashes in thedatabase.
 4. The server computer system of claim 1, wherein theoperations further include: after determining that other messages havenot previously been sent to the first network address, placing the firstmessage in a default queue.
 5. The server computer system of claim 1,wherein the latency times of the other messages associated with thefirst network address form a statistical distribution, and whereindetermining the latency value for response to the other messagesassociated with the first network address comprises: calculating astatistical parameter of the statistical distribution, wherein thestatistical parameter is one of a mean, a mode, or a median of thestatistical distribution, the latency value being the statisticalparameter.
 6. The server computer system of claim 1, wherein theoperations further include: after placing the first message in thesecond latency queue, generating an alert to the first recipientcomputer that the latency value for response is above the firstthreshold for the first network address.
 7. The server computer systemof claim 1, wherein the operations further include: dynamically changingthe first threshold based on a first number of messages in the firstlatency queue and based on a second number of messages in the secondlatency queue.
 8. The server computer system of claim 1, wherein themessages are sent to the recipient computers using at least one of HTTPor TCP.
 9. The server computer system of claim 1, wherein the operationsfurther include: comparing the latency value to a second threshold; anddetermining whether to place the first message in the second latencyqueue or a third latency queue based on the comparing of the latencyvalue to the second threshold.
 10. A method comprising: receiving, at aserver computer system, a plurality of messages including networkaddresses of recipient computers, each message including a networkaddress of a recipient computer; sending, by the server computer systemover a network, the messages to the recipient computers; determining alatency time for a confirmation response to be received by the servercomputer system for each of the plurality of messages; receiving, at theserver computer system, a first message including a first networkaddress of a first recipient computer; determining whether othermessages have previously been sent to the first network address of thefirst recipient computer; after determining that other messages havepreviously been sent to the first network address: determining a latencyvalue for response to the other messages associated with the firstnetwork address; comparing the latency value to a first threshold; anddetermining whether to place the first message in a first latency queueor in a second latency queue based on the comparing of the latency valueto the first threshold.
 11. The method of claim 10, wherein the firstlatency queue corresponds to one or more network addresses having lowerlatency values for responses than one or more network addressescorresponding to the second latency queue.
 12. The method of claim 10,further comprising: generating hashes of at least a portion of thenetwork addresses of the recipient computers for the plurality ofmessages; storing the hashes in a database; and generating a first hashof at least a portion of the first network address, wherein determiningthat other messages have previously been sent to the first networkaddress comprises comparing the first hash to the stored hashes in thedatabase.
 13. The method of claim 10, further comprising: afterdetermining that other messages have not previously been sent to thefirst network address, placing the first message in a default queue. 14.The method of claim 10, wherein the latency times of the other messagesassociated with the first network address form a statisticaldistribution, and wherein determining the latency value for response tothe other messages associated with the first network address comprises:calculating a statistical parameter of the statistical distribution,wherein the statistical parameter is one of a mean, a mode, or a medianof the statistical distribution, the latency value being the statisticalparameter.
 15. The method of claim 10, further comprising: after placingthe first message in the second latency queue, generating an alert tothe first recipient computer that the latency value for response isabove the first threshold for the first network address.
 16. The methodof claim 10, further comprising: dynamically changing the firstthreshold based on a first number of messages in the first latency queueand based on a second number of messages in the second latency queue.17. The method of claim 10, wherein the messages are sent to therecipient computers using at least one of HTTP or TCP.
 18. The method ofclaim 10, further comprising: comparing the latency value to a secondthreshold; and determining whether to place the first message in thesecond latency queue or a third latency queue based on the comparing ofthe latency value to the second threshold.